Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.

[F1T-11] Implement Navigation Functions into ROS - Version 2#13

Open
Rsleiman wants to merge 8 commits intomainfrom
F1T-11_nav_functions_version_2
Open

[F1T-11] Implement Navigation Functions into ROS - Version 2#13
Rsleiman wants to merge 8 commits intomainfrom
F1T-11_nav_functions_version_2

Conversation

@Rsleiman
Copy link
Collaborator

Description

Creates a "Navigation" Node, that subscribes to Odometry data and uses a callback function to:

  1. Process Odom data
  2. Calculate the desired heading, steering angle, and velocity (and acceleration, but may be unnecessary)

I created a temporary find_desired_velocity() function. Still waiting on the requested changes to be implemented on the velocity PR and then to be approved and merged to main.

main() function still needs work. Can't be 100% sure of layout until tickets are integrated.

Jira Link

[F1T-11]
https://jason2richards.atlassian.net/jira/software/projects/F1T/boards/2?selectedIssue=F1T-11

- Subscribes to Odometry data from /ego_racecar/Odom
- Callback function:
   1. Processes Odom data
   2. Calculates the desired heading, steering angle, and velocity (and acceleration, but may be unnecessary)
- Makes use of a temporary find_desired_velocity() function, waiting on that PR to be approved and merged to main.
@Rsleiman Rsleiman requested a review from richarJ2002 February 26, 2025 15:32
@Rsleiman Rsleiman self-assigned this Feb 26, 2025
@richarJ2002
Copy link
Contributor

In future can you use the PR template which is provided. All you have to do is ./SetUpEnvironment and it should setup the githooks and the PR template. After this sprint I will not be accepting PRs without the template.

Copy link
Contributor

@richarJ2002 richarJ2002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the function call is good however the commenting needs improving. When people read code what they tend to do is follow the comments and not the actual code. Even if the code is self explanatory it can be hard to read so just make sure you put a simple line explaining what each function call is. It may seem excessive but when dealing with robotics and developers shouting things at them in code is usually a good practice.

I would also say you need to think more on readability. Remember, your code will be read more times then it is written so try make things easy.

Overall though really good. Sorry for blunt comments I am too bust to care about tone atm.

navigation.py Outdated
from nav_msgs.msg import Odometry
from F1TenthAlgorithms.desired_acceleration import find_desired_acceleration
from F1TenthAlgorithms.desired_heading import find_desired_heading
from F1TenthAlgorithms.proportional_steering_angle import find_proportional_control_steering_angle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if there was an init.py file which did these imports for us an all you had to do was
from F1TenthAlgorithms import <function>.

Please do this in the F1TTenthAlgorithms folder.

Use this video to see what I mean https://www.youtube.com/watch?v=eUqLH1m92Yc&ab_channel=2MinutesPy

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I think I've done this now: f5a7a06

Pls check init.py file to see if thats what you meant. The changes I've made have allowed me to directly import the functions as if F1TenthAlgorithms is a package so I think I did it correctly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what the all does. It looks fine otherwise but could you explain what it does? If its not needed then I say get rid of it just to keep it simple.

Rsleiman added 7 commits March 3, 2025 11:16
- Adjusted import order
- Rm temporary velocity function and math import
- Removed contents of main function, but kept function to use as entrypoint
- Added references to tickets for TODOs
…nction

- Also corrected topic parameter from /odom to /egoracecar/odom
…anges to navigation.py

- __init__.py file allows us to directly import functions from the F1TenthAlgorithms scripts
- Changes were made to navigation.py to follow the coding conventions from notion
- From /egoracecar/odom to /ego_racecar/odom
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants